package com.ama.service.impl;

import com.ama.dao.UserDao;
import com.ama.model.User;
import com.ama.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User getUserById(int id) {
        return userDao.getUserById(id);

    }

    @Override
    @Transactional
    public void updateUser(User user) {
        userDao.updateUser(user);
        //int a = 10/0;
        System.out.println("update success");
    }
}
